<ion-view view-title="任务详情">
  <ion-content>
    <ion-refresher on-refresh="doRefresh()"
                   pulling-text="下拉刷新..."
                   refreshing-text="拼命加载中..."
                   refreshing-icon="ion-loading-b">

    </ion-refresher>
      <div class="list card" href="#">
        <div class="item">
          <h2>{{mymissions.area.areaName}}区-<span ng-if="(mymissions.orderInfo.get('type') != 9)">水果</span><span ng-if="(mymissions.orderInfo.get('type') === 9)">商家外卖</span>{{mymissions.orderid}}</h2>
        </div>
        <div class="item item-body">
          <p>
            派送地址：{{mymissions.address.address}}
          </p>
          <p>
            收件人：{{mymissions.address.name}} <a>{{mymissions.address.phone}}</a>
          </p>
          <p ng-if="(mymissions.orderInfo.get('type') != 9)">
            取件地址：{{mymissions.shop.areaName}}
          </p>
          <p ng-if="(mymissions.orderInfo.get('type') === 9)">
            取件地址：{{mymissions.orderInfo.get('sellerName')}}--{{mymissions.orderInfo.get('storeName')}}
          </p>
          <p>
            商品明细：
            <div ng-repeat="goods in mymissions.goods">
              {{goods.pname}} {{goods.sname}} {{goods.size}}*{{goods.price}}元
            </div>
          </p>
          <p>
            备注：{{mymissions.orderInfo.get('remark')}}
          </p>
          <p>
            支付方式：{{mymissions.orderInfo.get('payway')}} ({{mymissions.orderInfo.get('finalAmount')}}元)
          </p>
          <p>
            订单状态：{{mymissions.orderInfo.get('status') |  orderState }}
          </p>
          <p ng-if="mymissions.bookdate !=undefined">
            预约时间：{{mymissions.bookdate | date : 'yyyy-MM-dd HH:mm:ss'}}
          </p>
        </div>

        <div class="item">
          <button class="button button-block" ng-disabled="inDispatching===0" ng-click="dispatching(event)">开始派送</button>

          <button class="button button-block" ng-disabled="dispatchingSuccessful===0" ng-click="successfully(mymissions.orderInfo.get('payway'),mymissions.orderInfo.get('finalAmount'))">派送成功</button>
          <button class="button button-block"   ng-click="appointment()">预约派送</button>
          <div  ng-if="showAppointment==1">
            <div class="list card">
              <label class="item item-input">
                <div class="input-label">修改预约日期</div>
                <input type="date" ng-model="mymissions.yydate">
              </label>
            </div>

            <div class="list card">
              <label class="item item-input item-select">
                <div class="input-label">
                  选择时间
                </div>
                <select ng-model="mymissions.yytime">
                  <option selected>8</option>
                  <option>9</option>
                  <option>10</option>
                  <option>11</option>
                  <option>12</option>
                  <option>13</option>
                  <option>14</option>
                  <option>15</option>
                  <option>16</option>
                  <option>17</option>
                  <option>18</option>
                </select>
              </label>
            </div>
            <button class="button button-block" ng-click="sureBookdate(mymissions)">确认修改送货日期</button>
          </div>
        </div>
      </div>
    <div ng-if="(mymissions.length == 0)" class="card">
      <div class="item item-text-wrap">
        啥都没有~
      </div>
    </div>
  </ion-content>
</ion-view>
